package com.example.znyt.exception;

import lombok.Getter;

/**
 * @Description 自定义异常
 * @Date 2025/6/11 14:48
 * @Created by 12336
 */

@Getter
public class BussinessException extends RuntimeException{
    private final int code;

    public BussinessException(int code, String message) {
        super(message);
        this.code = code;
    }

    public BussinessException(ErrorCode errorCode) {
        super(errorCode.getMessage());
        this.code = errorCode.getCode();
    }

    public BussinessException(ErrorCode errorCode, String message) {
        super(message);
        this.code = errorCode.getCode();
    }
}
